<?php


namespace App\Models;


class EmailSend
{
    public function sendVerify($email,$subject,$content)
    {
        if(empty($email) || empty($content))
        {
            return array();
        }
        $param = array_merge(config('third_party_api.email_verify.param'),array(
            'to' => $email,
            'subject' => $subject,
            'html' => $content,
        ));
        $options = array(
            'http' => array(
                'method' => 'POST',
                'header' => 'Content-Type: application/x-www-form-urlencoded',
                'content' => http_build_query($param)
            )
        );
        $context  = stream_context_create($options);
        $send_result = file_get_contents(config('third_party_api.email_verify.url'), FILE_TEXT, $context);
        return json_decode($send_result,true);
    }
}